#include "MathHelper.h"

intptr_t MathHelper::CreateInstance()
{
	return reinterpret_cast<intptr_t>(new MathLib());
}

void MathHelper::DestroyInstance(intptr_t instance)
{
	auto mathLibInstance = reinterpret_cast<MathLib*>(instance);
	if (mathLibInstance != nullptr)
	{
		delete mathLibInstance;
		mathLibInstance = nullptr;
	}
}

double MathHelper::Add(intptr_t instance, double a, double b)
{
	return reinterpret_cast<MathLib*>(instance)->Add(a, b);
}

double MathHelper::Subtract(intptr_t instance, double a, double b)
{
	return reinterpret_cast<MathLib*>(instance)->Subtract(a, b);
}

double MathHelper::Multiply(intptr_t instance, double a, double b)
{
	return reinterpret_cast<MathLib*>(instance)->Multiply(a, b);
}

double MathHelper::Divide(intptr_t instance, double a, double b)
{
	return reinterpret_cast<MathLib*>(instance)->Divide(a, b);
}
